using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace EditorFrameWork
{
    [CustomEditorWindow(6)]
    public class SplitViewExample : EditorWindow
    {
        private SplitView m_SplitView;

        private void OnEnable()
        {
            m_SplitView = new SplitView();
            m_SplitView.FirstArea += SplitViewOnFirstArea;
            m_SplitView.SecondArea += SplitViewOnSecondArea;
        }

        private void SplitViewOnFirstArea(Rect obj)
        {
            obj.DrawOutLine(Color.green);
            GUI.Box(obj, "First");
        }

        private void SplitViewOnSecondArea(Rect obj)
        {
            obj.DrawOutLine(Color.green);
            GUI.Box(obj, "Second");
        }


        private void OnGUI()
        {
            m_SplitView.OnGUI(this.LocalPosition().Zoom(RectExtension.AnchorType.MiddleCenter, -10));
        }
    }
}